package com.caigou.comm.base.widget

import android.app.Dialog
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.Window
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import com.caigou.comm.R

/**
 * @author #Suyghur.
 * Created on 2022/02/24
 */
class AddFriendDialog(context: Context, private val nickName: String) : Dialog(context) {

    private lateinit var tvNickName: TextView
    lateinit var etRemark: EditText
    private lateinit var btnCancel: Button
    lateinit var btnConfirm: Button

    init {
        setCanceledOnTouchOutside(true)
        window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
        requestWindowFeature(Window.FEATURE_NO_TITLE)
        initView()
    }

    private fun initView() {
        setContentView(R.layout.dialog_add_friend)

        tvNickName = findViewById(R.id.add_friend_tv_nickname)
        tvNickName.text = "昵称：$nickName"

        etRemark = findViewById(R.id.add_friend_et_remark)

        btnCancel = findViewById(R.id.add_friend_btn_cancel)
        btnCancel.setOnClickListener {
            dismiss()
        }

        btnConfirm = findViewById(R.id.add_friend_btn_confirm)

    }
}